Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils_libvirt/libvirt_disk: add function to get disk by serial #3811

Closed
wants to merge 1 commit into from

Conversation

smitterl
Copy link
Contributor

@smitterl smitterl commented Dec 7, 2023

Use the SERIAL to identify a disk and return its path.

Suggested-by: Chunfu Wen [email protected]
Signed-off-by: Sebastian Mitterle [email protected]

Used in autotest/tp-libvirt#5323

@smitterl
Copy link
Contributor Author

smitterl commented Dec 7, 2023

@chunfuwen Please help review.

that's not mounted currently.

:param session: VM session
:param test: Test instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here there is no test parameter, others LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting it, fixed.

@smitterl smitterl requested a review from chunfuwen December 11, 2023 12:47
@smitterl smitterl marked this pull request as draft December 11, 2023 13:41
@smitterl
Copy link
Contributor Author

There might be an issue with this. Setting draft until I have confirmed it works also when the first item is the searched-for disk.

Use the SERIAL to identify a disk and return its path.

Suggested-by: Chunfu Wen <[email protected]>
Signed-off-by: Sebastian Mitterle <[email protected]>
@smitterl smitterl marked this pull request as ready for review December 11, 2023 18:49
@smitterl smitterl changed the title utils_libvirt/libvirt_disk: add function to discover new disk utils_libvirt/libvirt_disk: add function to get disk by serial Dec 11, 2023
@smitterl
Copy link
Contributor Author

@chunfuwen There was a problem with my implementation. At some point the 'new_disk' might also have been mounted during the tests. So, here I changed the patch to identifying with the serial as proposed by you autotest/tp-libvirt#5323 (comment)

Please can you review again?

@smitterl
Copy link
Contributor Author

Using the serial doesn't work for LUNS:
"error: unsupported configuration: scsi-block 'lun' devices do not support the serial property"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants